﻿using System;
using System.Runtime.Remoting.Channels;
using System.ServiceModel;
using LinFu.AOP.Interfaces;

namespace CoreEx.ServiceModel
{
    /// <summary>
    /// Represents a class that is capable of creating a <see cref="IInterceptor"/> that  
    /// forwards calls made to a service contract to an <see cref="IChannel"/> instance. 
    /// </summary>
    public interface IServiceContractInterceptorFactory
    {
        /// <summary>
        /// Creates a new <see cref="IInterceptor"/> instance.
        /// </summary>
        /// <param name="channelFactory">The <see cref="ChannelFactory{TChannel}"/> instance 
        /// used by the interceptor to create new channels.
        /// </param>
        /// <param name="serviceType">The type of service to intercept.</param>
        /// <returns><see cref="IInterceptor"/></returns>
        IInterceptor CreateServiceContractInterceptor(ChannelFactory channelFactory, Type serviceType);
    }
}
